
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="Python">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>build_features module &#8212; deepaugment 0.2.0 documentation</title>
    <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <script type="text/javascript" src="_static/language_data.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
   
  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
  
  
  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

  </head><body>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  <div class="section" id="module-build_features">
<span id="build-features-module"></span><h1>build_features module<a class="headerlink" href="#module-build_features" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="build_features.DataOp">
<em class="property">class </em><code class="descclassname">build_features.</code><code class="descname">DataOp</code><a class="reference internal" href="_modules/build_features.html#DataOp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#build_features.DataOp" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<dl class="staticmethod">
<dt id="build_features.DataOp.find_num_classes">
<em class="property">static </em><code class="descname">find_num_classes</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/build_features.html#DataOp.find_num_classes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#build_features.DataOp.find_num_classes" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="staticmethod">
<dt id="build_features.DataOp.load">
<em class="property">static </em><code class="descname">load</code><span class="sig-paren">(</span><em>dataset_name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/build_features.html#DataOp.load"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#build_features.DataOp.load" title="Permalink to this definition">¶</a></dt>
<dd><p>Loads dataset from keras and returns a sample out of it</p>
<dl class="docutils">
<dt>Args:</dt>
<dd>dataset_name (str):
training_set_size (int):
validation_set_size (int):</dd>
<dt>Returns:</dt>
<dd>dict: data, with keys X_train, Y_train, X_val, Y_val
list: input shape</dd>
</dl>
</dd></dl>

<dl class="staticmethod">
<dt id="build_features.DataOp.preprocess">
<em class="property">static </em><code class="descname">preprocess</code><span class="sig-paren">(</span><em>X</em>, <em>y</em>, <em>train_set_size</em>, <em>val_set_size=1000</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/build_features.html#DataOp.preprocess"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#build_features.DataOp.preprocess" title="Permalink to this definition">¶</a></dt>
<dd><dl class="docutils">
<dt>Preprocess images by:</dt>
<dd><ol class="first last arabic simple">
<li>normalize to 0-1 range (divide by 255)</li>
<li>convert labels to categorical)</li>
</ol>
</dd>
<dt>Args:</dt>
<dd>X (numpy.array):
y (numpy.array):
train_set_size (int):
val_set_size (int):</dd>
<dt>Returns:</dt>
<dd>dict: preprocessed data</dd>
</dl>
</dd></dl>

<dl class="staticmethod">
<dt id="build_features.DataOp.preprocess_normal">
<em class="property">static </em><code class="descname">preprocess_normal</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/build_features.html#DataOp.preprocess_normal"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#build_features.DataOp.preprocess_normal" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="staticmethod">
<dt id="build_features.DataOp.sample_validation_set">
<em class="property">static </em><code class="descname">sample_validation_set</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/build_features.html#DataOp.sample_validation_set"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#build_features.DataOp.sample_validation_set" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="staticmethod">
<dt id="build_features.DataOp.split_train_val_sets">
<em class="property">static </em><code class="descname">split_train_val_sets</code><span class="sig-paren">(</span><em>X</em>, <em>y</em>, <em>train_set_size</em>, <em>val_set_size</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/build_features.html#DataOp.split_train_val_sets"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#build_features.DataOp.split_train_val_sets" title="Permalink to this definition">¶</a></dt>
<dd><p>Splits given images randomly into <cite>train</cite> and <cite>val_seed</cite> groups</p>
<p>val_seed -&gt; is validation seed dataset, from where validation sets are sampled</p>
<dl class="docutils">
<dt>Args:</dt>
<dd>X (numpy.array):
y (numpy.array):
train_set_size (int):
val_set_size (int):</dd>
<dt>return:</dt>
<dd>dict: dict with keys <cite>X_train</cite>, <cite>y_train</cite>, <cite>X_val_seed</cite>, <cite>y_val_seed</cite></dd>
</dl>
</dd></dl>

</dd></dl>

</div>


          </div>
          
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">deepaugment</a></h1>








<h3>Navigation</h3>

<div class="relations">
<h3>Related Topics</h3>
<ul>
  <li><a href="index.html">Documentation overview</a><ul>
  </ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>








        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer">
      &copy;2019, Baris Ozmen.
      
      |
      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.8.3</a>
      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
      
      |
      <a href="_sources/build_features.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>